package com.briup.cms.service.impl;

import com.briup.cms.service.ICms_commentService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;


@Service
public class Cms_commentServiceImpl implements ICms_commentService {
    @Resource
    private Cms_commentMapper cms_commentMapper;

    @Override
    public List<Cms_comment> findAll() {

        return cms_commentMapper.selectAll();
    }

    @Override
    public void saveOrUpdate(Cms_comment cms_comment) {
        if (cms_comment.getId()!=null) {
            cms_commentMapper.update(cms_comment);
        }  else {
            cms_commentMapper.insert(cms_comment);
        }

    }


    @Override
    public void deleteById(long id) {
        cms_commentMapper.deleteById(id);
    }
}
